package com.jie.springwebapp.controller;

import com.jie.springwebapp.pojo.Emp;
import com.jie.springwebapp.pojo.Result;
import com.jie.springwebapp.service.EmpService;
import com.jie.springwebapp.service.impl.EmpServiceA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
@Controller
@RestController
public class EmpController {
    @Autowired
    private EmpService empService;
    @GetMapping("/list")
    public Result list() {
        List<Emp> empList = empService.listEmp();
        return Result.success(empList);
    }
}
